<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>央票通商品详情</title>
	<link rel="stylesheet" href="./resource/css/ypt_index.css">
	<link rel="stylesheet" href="./resource/css/ypt_s_product.css">

</head>
<?php
$user_id = session_get(UserEnum::USER_INFO_USER_ID);
$user_info = session_get(UserEnum::USER_INFO_SESSION_KEY);
?>
<body>
<!-- 顶部 -->
@include('common.shop_index_head')
		<!-- 详情 -->
<div class="content mt0 details">
	<div id="nk_top">
		<a href="javascript:;"><span>首页</span></a>
		<a>&gt;</a>
		<a id="firstkind" href="javascript:;">工具、附件、耗材</a>
		<a>&gt;</a>
		<a id="lastkind" href="javascript:void(0)">东工（TS）两用扳手/开口梅花两用扳手/架子工扳手 </a>
	</div>

	<div class="product_detail">
		<div class="info-img left">
			<div class="img-booth">
				<img src="" alt="" rel="">
			</div>
			<ul class="img-thumb">
				<li class="active"><img src="{{$info->img1}}" alt=""></li>
				<li><img src="{{$info->img2}}" alt=""></li>
				<li><img src="{{$info->img3}}" alt=""></li>
				{{--<li class="active"><img src="./resource/img/043435a.jpg" alt=""></li>--}}
				{{--<li><img src="./resource/img/043435b.jpg" alt=""></li>--}}
				{{--<li><img src="./resource/img/043435c.jpg" alt=""></li>--}}
			</ul>
			<ul class="info-arrow">
				<li class="pre"></li>
				<li class="next"></li>
			</ul>
		</div>
		<div class="product_prop">
			<h1>
				<span>{{$info->product_name}}</span>
			</h1>
			<div>
				<span class="til left">价格</span>
				<span class="red" id="price" price="{{$spec[0]->price}}">￥{{$spec[0]->price}}</span>
				<span class="red">/把</span>
			</div>
			<div><span class="til left">品牌</span><span>{{$info->brand_name}}</span></div>
			<div class="choose">
				<span class="til left">配送地区 </span>
				<a class='area'>
					<span>请选择</span><i class="idown idown_fr"></i>
					<div class="dv_area">
						<div class="area_body"><b></b>
							<ul class="title">
								<li>请选择城市</li>
							</ul>
							<ul class="area_content" id="proarea">
								<li>全国</li>
							</ul>
						</div>
					</div>
				</a>
			</div>
			<div class="choose spec">
				<span class="til left">规格</span>
				<div>
					@for($i=0;$i<count($spec);$i++)
						@if($i!=0)
							<a s_id="{{$spec[$i]->s_id}}">{{$spec[$i]->spec_name}}</a>
						@else
							<a class="a_on" s_id="{{$spec[$i]->s_id}}">{{$spec[$i]->spec_name}}</a>
						@endif
					@endfor
				</div>
			</div>
			<div class="add_dv">
				<span class="til left">采购量</span>
				<div class="info-num" stock_num="{{$info->stock}}">
					<a href="javascript:;" class="pre"></a>
					<input type="text" value="1" class="number" id="info-num">
					<a href="javascript:;" class="next"></a>
					<i>（最多购买{{$info->stock}}件）</i>
				</div>
			</div>
			@if(empty($user_id))
				<a class="a_cart a_login" href="javascript:;">加入购物车</a>
			@else
				<a class="a_cart a_cart_a" href="javascript:;">加入购物车</a>
			@endif
			<a class="a_ask" href="javascript:;">咨询卖方</a>
		</div>
	</div>
	<input type="hidden" id="product_id" value="{{$info->product_id}}">
	<input type="hidden" id="brand_id" value="{{$info->brand}}">

</div>
<div class="de_bg">
	<div class="product_detail main product-detail">
		<p class="title">
			<span>商品详情</span>
		</p>
		<div class="list_yanlun">
			<div class="content">
				<ul class="detail"></ul>
				<div class="red_bar"><span> 商品介绍</span><span class="fr">无忧配送</span><span class="fr">正品保证</span></div>
				<div class="brief">
					<p style="text-align: center;">
						<img src="http://www.xinfangsheng.com:80/resource/ImageZone/ueditor/image/20160511/1462939227539031333.jpg" title="1462939227539031333.jpg" alt="043460.jpg">
					</p>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 底部 -->
<div class="foot">
	<div class="main">
		<div class="left">
			<div class="foot-nav">
				<dl>
					<dt><span>关于央票通</span></dt>
					<dd>
						<a href="javascript:;" target="_blank">公司简介</a>
						<a href="javascript:;" target="_blank">团队介绍</a>
						<a href="javascript:;" target="_blank">加入我们</a>
						<a href="javascript:;" target="_blank">联系我们</a>
					</dd>
				</dl>
				<dl>
					<dt><span>新手上路</span></dt>
					<dd>
						<a href="javascript:;" target="_blank">新手专区</a>
						<a href="javascript:;" target="_blank">交易安全</a>
						<a href="javascript:;" target="_blank">24小时在线帮助</a>
						<a href="javascript:;" target="_blank">免费开店</a>
					</dd>
				</dl>
				<dl>
					<dt><span>配送方式</span></dt>
					<dd>
						<a href="javascript:;" target="_blank">货到付款</a>
					</dd>
				</dl>
				<dl>
					<dt><span>售后服务与保障</span></dt>
					<dd>
						<a href="javascript:;" target="_blank">保障范围</a>
						<a href="javascript:;" target="_blank">退货退款流程</a>
						<a href="javascript:;" target="_blank">服务中心</a>
					</dd>
				</dl>
				<dl>
					<dt><span>联系方式</span></dt>
					<dd>
						<a href="javascript:;" target="_blank">400-0678-797</a>
					</dd>
				</dl>
			</div>
			<div class="foot-info">
				<p>中企汇（北京）有限公司 京ICP备15043001   Copyright © 2016  yangpiaotong.com 版权所有</p>
			</div>
		</div>
		<div class="foot-code right">
			<img src="./resource/img/foot_code.png" alt="">
		</div>
	</div>
</div>

<div class="popup"></div>
<div class="popup-consultation">
	<div class="popup-bg">
		<div class="title"><div class="close"></div></div>
		<div class="mar"><div class="left">您可以在线咨询</div><a href="javascript:;"><img src="./resource/img/popup_qq.png" alt=""></a></div>
		<div class="mar"><div class="left">也可以拨打电话</div><span><i></i>400-036-7917</span></div>
	</div>
</div>
<script src="./resource/js/jquery-1.11.3.min.js"></script>
<script src="./resource/js/ypt_index.js"></script>
<script src="./resource/js/ypt_s_ShopShow.js"></script>
<script src="./resource/js/ypt_s_showBo.js"></script>
<script src="./resource/js/jquery.imagezoom.min.js"></script>
<script>
	//导航 商品全部 隐藏显示
	var $allW = $('.all-wrap');
	$allW.hide();
	$('.nav .nav-all').attr('rel','hide');
	$('.nav .nav-all').click(function(){
		if($(this).attr('rel') == 'hide'){
			$(this).attr('rel','show');
			$allW.show();
		}else{
			$(this).attr('rel','hide');
			$allW.hide();
		};
	});
	//图片 放大镜
	$(".img-booth img").imagezoom();

	//咨询卖方
	$('.a_ask').click(function(){
		$('.popup').show();
		$('.popup-consultation').show();
	});
	$('.popup').click(function(){
		$('.popup').hide();
		$('.popup-consultation').hide();
	});
	$('.popup-consultation .close').click(function(){
		$('.popup').hide();
		$('.popup-consultation').hide();
	});
	//加入购物车

	$('.a_cart_a').click(function(){
		var product_id = $("#product_id").val();
		var brand_id   = $("#brand_id").val();
		var num        = $("#info-num").val();
		var price      = $("#price").attr('price');
		var s_id       = $(".spec a.a_on").attr('s_id');
		var a_price	   = num * price;
		//console.log(product_id+"||"+brand_id+"||"+num+"||"+price+"||"+s_id+"||"+a_price);
			$.ajax({
				type: "GET",
				url: "/cart_add",
				data:  {product_id:product_id,brand_id:brand_id,num:num,s_id:s_id,a_price:a_price},
				success: function(msg){
					console.log(msg)
				}
			});
		Showbo.Msg.amend('<img class="left" src="./resource/img/reg_success.png" alt=""><span style="float:left;line-height:72px;">加入购物车成功!</span>',function(btn){
			if (btn == 'yes') {
				window.location.href = '/ypt_shop_cart';
			}else{
				return false;
			};
		},'查看购物车');
		$('#dvMsgBox input.btn').css('width','100px');
		$('#dvMsgClose').css({
			'display':'block',
			'left': '450px',
			'top': '14px',
			'width': '25px',
			'height': '25px',
			'background': 'url(img/index_pic.png) no-repeat -163px -376px',
			'border':'none'
		});
	});
</script>
</body>
</html>s